import request from '/@/utils/request';

// 查询订单列表
export function listOrder(query?: Object) {
  return request({
    url: '/module/order/list',
    method: 'get',
    params: query
  })
}

// 查询订单列表
export function listOrderStatistics(query?: Object) {
  return request({
    url: '/module/order/statistics/list',
    method: 'get',
    params: query
  })
}


// 查询订单列表
export function listMerOrder(query?: Object) {
  return request({
    url: '/module/order/mer/list',
    method: 'get',
    params: query
  })
}


// 查询订单列表
export function productEchart(query?: Object) {
  return request({
    url: '/module/order/restaurant/product/echart',
    method: 'get',
    params: query
  })
}






export function listByFenrun(query?: Object) {
  return request({
    url: '/module/order/listByFenrun',
    method: 'get',
    params: query
  })
}

// 查询订单详细
export function getOrder(id?: number) {
  return request({
    url: '/module/order/' + id,
    method: 'get'
  })
}

// 查询订单详细
export function getMerOrder(id?: number) {
  return request({
    url: '/module/order/mer/' + id,
    method: 'get'
  })
}

export function updateMerOrder(id?: number) {
  return request({
    url: '/module/order/updateMer/' + id,
    method: 'put'
  })
}
// 新增订单
export function addOrder(data?: Object) {
  return request({
    url: '/module/order',
    method: 'post',
    data
  })
}

// 修改订单
export function updateOrder(data?: Object) {
  return request({
    url: '/module/order',
    method: 'put',
    data
  })
}

export function updateVipOrder(data?: Object) {
  return request({
    url: '/module/order/vip',
    method: 'put',
    data
  })
}

export function restaurantSettleOrder(data?: Object) {
  return request({
    url: '/module/order/restaurant/settle',
    method: 'put',
    data
  })
}

export function changeTable(data?: Object) {
  return request({
    url: '/module/order/changeTable',
    method: 'put',
    data
  })
}


// 订单退款
export function refundOrder(data?: Object) {
  return request({
    url: '/module/order/refund',
    method: 'put',
    data
  })
}


// 删除订单
export function delOrder(id?: number) {
  return request({
    url: '/module/order/' + id,
    method: 'delete'
  })
}

// 核销订单
export function verifyOrder(id?: number) {
  return request({
    url: '/module/order/verify/' + id,
    method: 'post'
  })
}



// 打印订单
export function printOrder(id?: number) {
  return request({
    url: '/module/order/print/' + id,
    method: 'get',
  })
}

export function printOrder0(id?: number) {
  return request({
    url: '/module/order/print0/' + id,
    method: 'get',
  })
}

export function printOrder1(id?: number) {
  return request({
    url: '/module/order/print1/' + id,
    method: 'get',
  })
}

export function printOrder2(id?: number) {
  return request({
    url: '/module/order/print2/' + id,
    method: 'get',
  })
}

export function printOrderCounter(id?: number) {
  return request({
    url: '/module/order/printCounter/' + id,
    method: 'get',
  })
}
// 导出订单
export function exportOrderTotal(query?: Object) {
  return request({
    url: '/module/order/exportTotal',
    method: 'get',
    params: query
  })
}


// 导出订单
export function exportOrderMerTotal(query?: Object) {
  return request({
    url: '/module/order/exportMerTotal',
    method: 'get',
    params: query
  })
}


// 导出订单
export function exportOrderMerDetail(query?: Object) {
  return request({
    url: '/module/order/exportMerDetail',
    method: 'get',
    params: query
  })
}

// 导出订单
export function exportOrder(query?: Object) {
  return request({
    url: '/module/order/export',
    method: 'get',
    params: query
  })
}

